import request from '@/utils/request'

// 获取组织架构数据接口函数
export const getDapartments = () => request({
  url: '/company/department'
})

// 删除部门功能实现
export const delDapartments = (id) => request({
  url: `/company/department/${id}`,
  method: 'delete'
})

// 新增部门功能实现
export const addDepartments = (data) => request({
  url: '/company/department',
  method: 'post',
  data
})

// 获取部门接口
export const getDepartmentsDetail = (id) => request({
  url: `/company/department/${id}`
})

// 编辑部门接口
export const updateDepartments = (data) => request({
  url: `/company/department/${data.id}`,
  method: 'put',
  data
})
